/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 三石
 * Date: 2022-04-25
 * Time: 15:26
 */

class Node{
    public int date;
    public Node next;

    public Node(int date){
        this.date=date;
        this.next=null;
    }
}

public class Mylinkedlist {
    public Node head;  //保存单链表的头节点的引用 null

    //头插法
    public void addFirst(int date){
        Node node=new Node(date);
        if(this.head==null){
            //第一次插入
            this.head=node;
            return;
        }
        note.next=this.head;
        this.head=node;
    }
    //打印链表
    public void display(){
        Node cur=this.head;
        while (cur!=null){
            System.out.println(cur.date+" ");
            cur=cur.next;
    }
}

